package org.mnj07.i18n;

import java.util.*;

public class I18NDemo {

  public static void main(String[] args) {

    String language;
    String country;

    if (args.length != 2) {
        language = new String("en");
        country = new String("US");
    } else {
        language = new String(args[0]);
        country = new String(args[1]);
    }

    Locale currentLocale = new Locale(language, country);
    ResourceBundle resourceBundle = ResourceBundle.getBundle("MessagesBundle", currentLocale);
    
    System.out.println(resourceBundle.getString("greetings"));
    System.out.println(resourceBundle.getString("inquiry"));
    System.out.println(resourceBundle.getString("farewell"));
  }
}
